import React, { Component } from 'react';

class NoSupport extends Component {

    constructor(props) {
        super(props);
        this.state = {
            isSupport: false,
        };
    }

    componentDidMount() {
        try {
            const renderer = new THREE.WebGLRenderer();
            this.setState({ isSupport: true });
        } catch (e) {
            this.setState({ isSupport: false });
        }
    }

    render() {
        return ( 
            <h1>{this.state.isSupport ? '' : '对不起，您的浏览器不支持WebGL。'}</h1>
        )
    }
}

export default NoSupport;
